<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .top1 {
            height: 80px;
            background: blue;
            /* 固定定位 */
            position: fixed;
            width: 100%;
            /* 会脱标  相对浏览器可视区域移动*/
        }
    </style>
</head>

<body>
    <div class="top1"></div>
    <div class="top2" style="height: 3000px;"></div>
</body>

</html>